<?php


namespace app\mini\controller\v1\shop;

use app\common\logic\MoneyRecordLogic;
use app\mini\controller\Common;
use think\Request;
use think\response\Json;

class MoneyRecord extends Common
{
    public $MoneyRecordLogic;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->MoneyRecordLogic = new MoneyRecordLogic();
    }

    /**
     * 消费记录
     * @return Json
     */
    public function index(): Json
    {
        $res = $this->exception(function (){
            return $this->MoneyRecordLogic->index(request()->param());
        });
        return $this->response($res);
    }


    /**
     * 消费记录
     * @return Json
     */
    public function consumeRecord(): Json
    {
        $res = $this->exception(function (){
            return $this->MoneyRecordLogic->shopConsumeRecord(request()->param());
        });
        return $this->response($res);
    }

    /**
     * 充值记录
     * @return Json
     */
//    public function rechargeRecord(): Json
//    {
//        list($data, $meta) = $this->exception(function () {
//            return $this->MoneyRecordLogic->shopRechargeRecord(request()->param());
//        });
//        $res = array_merge(['data' => $data], $meta);
//        return $this->response($res);
//    }
}